package com.t7;

/**
 * Created by xuyiwei on 2018/7/18.
 */
class Cleaner{
    private String s = "Cleanser";
    public void append(String a){
        s+= a;
    }

    public void dilute(){
        append(" dilute() ");
    }

    public void apply(){
        append(" apply() ");
    }

    public void scrub(){
        append(" scrub() ");
    }

    @Override
    public String toString() {
        return s;
    }

    public static void main(String[] args) {
        Cleaner cleaner = new Cleaner();
        cleaner.dilute();
        cleaner.apply();
        cleaner.scrub();
        System.out.println(cleaner);
    }
}
public class Detergent extends Cleaner{
//    public void scrub(){
//        append(" Detergent.scrub() ");
//        super.scrub();
//    }


    @Override
    public void scrub() {
        System.out.println("qww");
    }

    public void foam(){
        append(" foam() ");
    }

    public static void main(String[] args) {
        Detergent detergent = new Detergent();
        detergent.dilute();
        detergent.apply();
        detergent.scrub();
        detergent.foam();
        System.out.println(detergent);
        Cleaner1.main(args);
    }
}

